from flask_caching import Cache
import config

cf = config.get_redis_config()


cache_config = {
    "DEBUG": True,          # some Flask specific configs
    "CACHE_TYPE": "RedisCache",  # Flask-Caching related configs
    # "CACHE_TYPE": "simple",  # Flask-Caching related configs
    "CACHE_DEFAULT_TIMEOUT": 300,
    "CACHE_REDIS_HOST": cf["host"],
    "CACHE_REDIS_PORT": cf["port"],
    "CACHE_REDIS_PASSWORD": cf["password"],
    "CACHE_REDIS_DB	": cf["db"],
}

cache = Cache(config=cache_config)
